package com.frinder.demo6;

import akka.actor.UntypedActor;
import akka.event.Logging;
import akka.event.LoggingAdapter;

/**
 * Created by frinder on 2017/7/25.
 */
public class PrintActor extends UntypedActor {

    final LoggingAdapter logger = Logging.getLogger(getContext().system(), this);


    @Override
    public void onReceive(Object o) throws Exception {
        logger.info("{} {}", getClass().getName(), o);
        if (o instanceof Integer) {
            logger.info("print {}", o);
        } else {
            unhandled(o);
        }
    }
}
